﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GrewalCRM.Entities;

namespace GrewalCRM.Entities
{
  public class InstallersMaster : BaseEntitiesGrewalCRM
  {
    #region Members   
    private string installerName;
		private string address;
		private string phoneNo;
		private string mobileNo;
    private decimal? installerCommission; 
    #endregion

    #region Constructors
    /// <summary>
    /// Create a new instance using the default constructor
    /// </summary>
    public InstallersMaster():base()
    {      
    }

    /// <summary> 
    /// Create a new object using the minimum required information (all not-null fields except 
    /// auto-generated primary keys). 
    /// </summary> 
    public InstallersMaster(string installerName, string address, string mobileNo, UserCRM lastModifiedUser)
      : base(lastModifiedUser)
    {
      this.installerName = installerName;
      this.address = address;
      this.mobileNo = mobileNo;      
    }

    /// <summary> 
    /// Create a new object by specifying all fields (except the auto-generated primary key field). 
    /// </summary> 
    public InstallersMaster(string installerName, string address, string phoneNo, string mobileNo, decimal? installerCommission, UserCRM lastModifiedUser)
      : base(lastModifiedUser)
    {

      this.installerName = installerName;
      this.address = address;
      this.phoneNo = phoneNo;
      this.mobileNo = mobileNo;
      this.installerCommission = installerCommission;
    }   

     /// <summary> 
    /// Create an object from an existing row of data with only ID feild 
    /// </summary> 
    public InstallersMaster(int installerID)
      : base(installerID, null, null)
    {

    }

    /// <summary> 
		/// Create an object from an existing row of data. This will be used by Gentle to 
		/// construct objects from retrieved rows. 
		/// </summary> 
    public InstallersMaster(int installerID, string installerName, string address, string phoneNo, string mobileNo, decimal? installerCommission, bool isActive, UserCRM lastModifiedUser, DateTime? lastModifiedDateTime)
      : base(installerID, isActive, lastModifiedUser, lastModifiedDateTime)
		{			
			this.installerName = installerName;
			this.address = address;
			this.phoneNo = phoneNo;
			this.mobileNo = mobileNo;
      this.installerCommission = installerCommission;
    }
    #endregion

    #region Public Properties    
    /// <summary>
    /// Property relating to database column InstallerName
    /// </summary>
    
    public string InstallerName
    {
      get { return installerName != null ? installerName.TrimEnd() : string.Empty; }
      set { IsChanged |= installerName != value; installerName = value; }
    }

    /// <summary>
    /// Property relating to database column Address
    /// </summary>
    
    public string Address
    {
      get { return address != null ? address.TrimEnd() : string.Empty; }
      set { IsChanged |= address != value; address = value; }
    }

    /// <summary>
    /// Property relating to database column PhoneNo
    /// </summary>
    
    public string PhoneNo
    {
      get { return phoneNo != null ? phoneNo.TrimEnd() : string.Empty; }
      set { IsChanged |= phoneNo != value; phoneNo = value; }
    }

    /// <summary>
    /// Property relating to database column MobileNo
    /// </summary>
    
    public string MobileNo
    {
      get { return mobileNo != null ? mobileNo.TrimEnd() : string.Empty; }
      set { IsChanged |= mobileNo != value; mobileNo = value; }
    }

    /// <summary>
    /// Property relating to database column InstallerCommission
    /// </summary>    
    public decimal? InstallerCommission
    {
      get { return installerCommission; }
      set { IsChanged |= installerCommission != value; installerCommission = value; }
    }
    #endregion


  }
}
